﻿using System.Collections.Generic;

namespace IcicleFramework.Components.Metadata
{
    public interface IMetadataComponent : IBaseComponent
    {
        /// <summary>
        /// Adds a new Metadata entry to this Component.
        /// </summary>
        /// <param name="key">The key or name of the Metadata</param>
        /// <param name="value">An associated object for this Metadata (if required).</param>
        void AddMetadata(string key, object value);

        /// <summary>
        /// Adds an associated object to an existing Metadata entry (replaces any existing object).
        /// </summary>
        /// <param name="key">The key/name of the existing Metadata entry.</param>
        /// <param name="value">The object to insert/replace.</param>
        void ChangeValue(string key, object value);

        /// <summary>
        /// Returns whether or not the provided Metadata key exists.
        /// </summary>
        /// <param name="key">The Metadata key to search for.</param>
        /// <returns>True if the Metadata key was found, false if otherwise.</returns>
        bool HasMetadata(string key);

        /// <summary>
        /// Returns the associated Metadata with a given key.
        /// </summary>
        /// <param name="key">The Metadata key to retrieve the object from.</param>
        /// <returns>The associated Metadata object, or null if the key does not exist.</returns>
        /// <remarks>The associated Metadata object may also be null even if the key exists.</remarks>
        object GetMetadata(string key);
    }
}
